<?php $this->load->view("common/header") ?>
<body>
  <div id="page_wrapper">
<?php $this->load->view("common/speel") ?>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td  align="left" valign="top"><?php $this->load->view("nav/main") ?></td>
      <td  valign="top" id="mainContent">
      <div id="crum">
<?php echo $crum ?>
</div><br>
<div id="msg" align="center"><span class="pageMsg"><?php echo $msg ?></span></div>
      <form name="form1" method="post" action="<?php echo base_url() ."client/editclient/" ?>">
<table width="600" border="0" align="left" cellpadding="3" cellspacing="3">
            <tr>
              <td class="tbl_header" colspan="4">Update Client </td>
              
          </tr>
            <tr>
              <td class="tblBodyNoneHover" colspan="4"><span class="pageMsg"><?php echo $msg ?></span></td>
            </tr>
            <tr>
              <td width="104" class="tbl_field_lable">Client Name</td>
              <td colspan="3" class="tbl_field_input"><input name="client_name" type="text" id="client_name" size="40" value="<?php  echo $client[0]['company_name'] ?>" /></td>
            </tr>
            <tr>
              <td valign="top" class="tbl_field_lable">Contact 1</td>
              <td colspan="3" valign="top" class="tbl_field_input"><input name="client_contact1" type="text" id="client_contact1" size="40" value="<?php  echo $client[0]['company_contact1'] ?>" /></td>
            </tr>
            <tr>
              <td valign="top" class="tbl_field_lable">Contact 2</td>
              <td colspan="3" valign="top" class="tbl_field_input"><input name="client_contact2" type="text" id="client_contact2" size="40" value="<?php echo  $client[0]['company_contact2'] ?>" /></td>
            </tr>
            <tr>
              <td valign="top" class="tbl_field_lable">Phone</td>
              <td colspan="3" valign="top" class="tbl_field_input"><input name="client_phone1" type="text" id="client_phone1" size="40" value="<?php  echo $client[0]['company_phone1'] ?>" /></td>
            </tr>
            <tr>
              <td valign="top" class="tbl_field_lable">Fax</td>
              <td colspan="3" valign="top" class="tbl_field_input"><input name="client_phone2" type="text" id="client_phone2" size="40" value="<?php  echo $client[0]['company_phone2'] ?>" /></td>
            </tr>
            <tr>
              <td valign="top" class="tbl_field_lable">Email</td>
              <td colspan="3" valign="top" class="tbl_field_input"><input name="client_email" type="text" id="client_email" size="40" value="<?php  echo $client[0]['company_email'] ?>" /></td>
            </tr>
            <tr>
              <td valign="top" class="tbl_field_lable">Address </td>
              <td colspan="3" valign="top" class="tbl_field_input"><input name="client_address1" type="text" id="client_address1" size="40" value="<?php  echo $client[0]['company_address1'] ?>" ></td>
            </tr>
            <tr>
              <td valign="top" class="tbl_field_lable">Suburb</td>
              <td colspan="3" valign="top" class="tbl_field_input"><input name="client_suburb" type="text" id="textfield8" size="40" value="<?php  echo $client[0]['company_suburb'] ?>" /></td>
            </tr>
                        <tr>
              <td valign="top" class="tbl_field_lable">State</td>
              <td width="117" valign="top" class="tbl_field_input"><select name="client_state" id="client_state">
                <?php foreach($states as $state) { ?>
                <option 
                <?php if ($client[0]['company_state'] == $state['lu_value'] )  echo 'selected'; ?>
                value="<?php echo $state['lu_value'] ?>"><?php echo $state['lu_lable']?></option>
                <?php } ?>
              </select></td>
              <td width="80" valign="top" class="tbl_field_lable" style="width:40px">Postcode</td>
              <td width="167" valign="top" class="tbl_field_input"><input name="client_postcode" type="text" id="client_postcode" size="5" value="<?php  echo $client[0]['company_postcode'] ?>" /></td>
            </tr>
            <tr>
                          <td class="tbl_field_lable">Charge rate</td>
                          <td colspan="3" class="tbl_field_input"><label for="charge_rate"></label>
                            <input name="charge_rate" type="text" id="charge_rate" value="<?php  echo $client[0]['charge_rate'] ?>" size="8"></td>
            </tr>
                        <tr>
                          <td class="tbl_field_lable">Interval / Unit</td>
                          <td colspan="3" class="tbl_field_input"><label for="interval"></label>
                            <select name="interval" id="interval">
                              <?php echo gen_interval($client[0]['interval']) ?>
                            </select></td>
                        </tr>
                        <tr>
                          <td class="tbl_field_lable">Job history for</td>
                          <td colspan="3" class="tbl_field_input"><label for="select"></label>
                            <select name="select" id="client_job_history">
                              <option value="0">Select period</option>
                              <option value="7d">7 Days</option>
                              <option value="14d">14 Days</option>
                              <option value="1m">1 Month</option>
                              <option value="3m">3 Months</option>
                              <option value="6m">6 Months</option>
                              <option value="12m">12 Months</option>
                          </select></td>
                        </tr>
            <tr>
              <td><input name="action" type="hidden" id="action" value="editClient">
              <input name="client_id" type="hidden" id="client_id" value="<?php echo $client[0]['id'] ?>" ></td>
              <td colspan="3" class="tbl_field_input"><input name="button" type="submit" class="tblBtn" id="button" value=" Update Client  "></td>
            </tr>
        </table>
        
      </form></td>
    </tr>
</table>

<?php $this->load->view("common/footer") ?>
</div>
</body>
</html>
